<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
    <title>{%block title%}Wandering Books{%endblock%}</title>

    <link href='/static/master.css' rel='stylesheet' type='text/css' />
    <link rel="shortcut icon" type="image/vnd.microsoft.icon"
        href="/static/favicon.ico" />
    
    {%block javascript%}
    <script language="javascript" src="/static/google-book-search.js"></script>
    <script language="javascript">
        /* XXX: should set focus to first field in form,
        regardless of field name (see login.pt) */
        function setfocus() { document.forms[0].query.focus() }

    </script>
    {%endblock%}

</head>
<body onload="setfocus()">
    
  <div class="top">
    <a href="/""><!-- XXX: how to link to the home view configured in url.py?-->
        <img src="/static/circulante-logo-transp-212x51.png"
        title="Circulante.org" width="212" height="51" />
    </a>
    <ul class="menu">
        {%if user.is_anonymous%}
        <li><a href="/join/">join</a></li>
        {%endif%}
        {%if user.is_authenticated%}
        <li><a href="/u/{{user.username}}">{{user.username}}'s collection</a></li>
        {%endif%}
        <li><a href="/pac/">collective catalog</a></li>
        <li class="noborder"><form action="/pac/"
          ><input type="text" name="query" value="{{query}}"
          >&nbsp;<input type="submit" name="submit" value="search"
          ></form></li>    
    </ul>
  </div>
  {%block body%}
    <div class="content_menu">
      {%block content_menu%}
        <span class="content_title">
          {%block headline%}
            Content title
          {%endblock%}
        </span>
        <span class="content_login">
        {%if usr%}
              login: {{usr.username}}
        {%endif%}
        </span>
        <span class="user_menu">
            {%block user_menu%}
           <ul class="menu">
              {%if user.is_anonymous%}
              <li class="noborder"><form action="/login/" method="post"
                >login&nbsp;<input
                    type="text" name="username" id="username" value="{{username}}"
                    >&nbsp;&nbsp;password&nbsp;<input type="password"
                    name="password" id="password" />&nbsp;<input type="submit"
                    name="login_submit" value="log in" /><input type="hidden"
                    name="next" value="/"></form></li>
              {%endif%}
              {%if user.is_authenticated%}
                 <li><a href="/add_items">add books</a></li>
                 <li><a href="/logout/">logout</a></li>
              {%endif%}
            </ul>
            {%endblock%}<!--/user_menu-->
        </span>
        
      {%endblock%}<!--/content_menu-->
    </div>
    {%if messages%}
        <ul>
        {%for message in messages%}
            <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    <div class="content">
      {%block content%}
      Welcome to Circulante / Wandering Books
      {%endblock%} <!--/content-->
    </div>
  {%endblock%} <!--/body-->
</body>
</html>
